<?php
/**
* The main file of xdcms, calls every other file that is needed
*
* This is the only file in xdcms that is called directly, every other file is called through this one.
*  It sets up xdcms by including the configuration files and the general functions.  It also calls 
* modules by implementing the urlFinder
*@author		wil hamilton <wil.hamilton@gmail.com>
*@license		bsd
*@version		0.5
*@package		core
* @todo 		finish commenting, update URL finder section to include a module defined in by the user instead of jus tthe main module
 */

/**
 * Start sessions and output buffering to allow xd to function properly.  Also, turn off error reporting.
 */
session_start();
ob_start();
//error_reporting(E_ERROR); 		//error reporting turned off for testing

 
/**
 * include the general and plugin configuration files
 */
require('config.php');
include(ROOT . 'plugins/config.php');

/**
 * include the general function, which is required for operation
 * throws an exception if it cannot include this file, for xd wont work without it
 */
if(!include(ROOT . 'core/general.functions.php'))
{
	throw new Exception("Fatal Error: Could not include general functions.");
}

moduleLoader::getModule(array_key_exists('PATH_INFO', $_SERVER) ? $_SERVER['PATH_INFO'] : '');
#eof
?>